/*****************************************************
*                                                                          
*               COPYRIGHT (c) 2015-2017 Broadlink Corporation              
*                         All Rights Reserved                              
*                                                                          
* The source code contained or described herein and all documents          
* related to the source code ("Material") are owned by Broadlink         
* Corporation or its licensors.  Title to the Material remains             
* with Broadlink Corporation or its suppliers and licensors.               
*                                                                          
* The Material is protected by worldwide copyright and trade secret        
* laws and treaty provisions. No part of the Material may be used,         
* copied, reproduced, modified, published, uploaded, posted, transmitted,  
* distributed, or disclosed in any way except in accordance with the       
* applicable license agreement.                                            
*                                                                          
* No license under any patent, copyright, trade secret or other            
* intellectual property right is granted to or conferred upon you by       
* disclosure or delivery of the Materials, either expressly, by            
* implication, inducement, estoppel, except in accordance with the         
* applicable license agreement.                                            
*                                                                          
* Unless otherwise agreed by Broadlink in writing, you may not remove or   
* alter this notice or any other notice embedded in Materials by Broadlink 
* or Broadlink's suppliers or licensors in any way.                        
*                                                                          
** Author: shengda.huang
** Date: 2019-02-18
*
*****************************************************/

/***** Include files ********************************/
#include <semaphore.h>

/***** Defines **************************************/

/***** Define structure *****************************/

/***** Define constant ******************************/

/***** Define global ********************************/
/*
static osSemaphoreDef(heap_sem);
static osSemaphoreId _heap_sem_id;
*/
sem_t _heap_sem_id;

/***** Define Prototype of functions ****************/

/**
 * @brief
 * @param  None
 * @retval None
 */
void dymem_adapter_init(void)
{
	//_heap_sem_id = osSemaphoreCreate (osSemaphore(heap_sem), 1);
    sem_init(&_heap_sem_id, 0, 1);
}

int dymem_adapter_sem_wait(void)
{
	return sem_wait(&_heap_sem_id);
}

int dymem_adapter_sem_post(void)
{
	return sem_post(&_heap_sem_id);
}

/* End of file */



